<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>幻想入</title>

<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />

<jsp:include page="bootstrap/inc.jsp"></jsp:include>



<style type="text/css">
body {
	background-image: url("bootstrap/img/6(1).jpg");
	background-size: 1366px 768px;
}
</style>
<script type="text/javascript">
	function checkName() {
		//获取用户名输入控件对象的内容
		var txtUserName = document.getElementById("txtUserName").value;
		//信息提示框
		var sptxtName = document.getElementById("sptxtName");
		if (txtUserName == null || txtUserName == "") {
			//验证失败
			isChecked = false;
			//提示信息					
			sptxtName.innerHTML = "请输入姓名！";
			sptxtName.style.color = "red";
			//msg += "请输入姓名！\n"
			document.getElementById("txtUserName").focus();
			//修改标志变量
			return false;
		} else {
			sptxtName.innerHTML = "";
			//修改标志变量
			return true;
		}
	}

	function checkPsw() {
		//密码非空验证
		var txtUserPsw = document.getElementById("txtUserPsw").value;

		//信息提示框
		var sptxtPsw = document.getElementById("sptxtPsw");
		if (txtUserPsw == null || txtUserPsw == "") {

			//错误提示信息
			//提示信息					
			sptxtPsw.innerHTML = "请输入密码！";
			sptxtPsw.style.color = "red";
			return false;
		} else {
			//验证通过  清空提示内容
			sptxtPsw.innerHTML = "";
			return true;
		}
	}
	function checkMe() {
		//用户名验证
		var ischName = checkName();
		//密码验证
		var ischPsw = checkPsw();

		if (ischName && ischPsw) {
			//验证通过
			return true;
		} else {
			return false;
		}
	}
</script>
</head>
<body>
	<h1 align="center">登录页面</h1>

	<form action="LoginServlet" method="post" class="form-horizontal"
		role="form" style="width: 800px">
		<div class="form-group">
			<label for="inputEmail3" class="col-sm-2 control-label">用户名</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" id="txtUserName"
					name="txtUserName" onblur="checkName();" placeholder="用户名">
				<div>
					<span id="sptxtName"></span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label for="inputPassword3" class="col-sm-2 control-label">密码</label>
			<div class="col-sm-10">
				<input type="password" class="form-control" id="txtUserPsw"
					name="txtUserPsw" onblur="checkPsw(this);" placeholder="密码">
				<div>
					<span id="sptxtPsw"></span>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label" for="txtUserAddress">身份</label>
			<div class="col-sm-4">
				<label class="radio-inline"> <input type="radio"
					name="selectSt" id="selectSt1" value="老师"> 老师
				</label> <label class="radio-inline"> <input type="radio"
					name="selectSt" id="selectSt2" value="学生"> 学生
				</label>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<div class="checkbox">
					<label> <input type="checkbox"><font face="微软雅黑">记住我</font>
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="reset" class="btn btn-default">重置</button>
				<button type="submit" class="btn btn-default"
					onclick="return checkMe();">登录</button>
			</div>
		</div>
	</form>
</body>
</html>
